let thirdapi_lists = query({
	model: "thirdapi",
	field_string: `id name operation_id method default_params default_fz_body request_url`
})

let actionflow_lists = query({
	model: "actionflow",
	field_string: `id name actionflow_dir attach_data describe jscode`
})

let system_lists = query({
	model: "system",
	field_string: `id system_id name province city area mobile address_detail wx_pub_config wx_mini_config wx_union_config actionflow_config attach_config`
})

let authtoken_lists = query({
	model: "authtoken",
	field_string: `id type app_id thirdapi_name default_params default_fz_body default_field_string access_token_path refresh_token_path`
})


let thirdapi_nlists = [];
let actionflow_nlists = [];
let system_nlists = [{
	system_id: 1,
	name: "城市脉动测试",
	province: "四川省",
	city: "德阳市",
	area: "广汉市",
	wx_mini_config: {
		app_id: "",
		app_secret: ""
	},
	wx_mini_config: {},
	wx_union_config: {},
	actionflow_config: {
		actionflow_id: "5e5e155d-7b3c-4771-bf94-ceb597cbb666",
		refund_actionflow_id: "",
		createpay_actionflow_id: "",
		getpayinfo_actionflow_id: ""
	},
	attach_config: {}
}];
let authtoken_nlists = [];



system_nlists = system_nlists.filter(item => {
	let system = system_lists.find(system => system.name == item.name);
	if (system.name) {
		return false
	} else {
		return true
	}
})

actionflow_nlists = actionflow_nlists.filter(item => {
	let actionflow = actionflow_lists.find(actionflow => actionflow.name == item.name);
	if (actionflow.name) {
		return false
	} else {
		return true
	}
})

thirdapi_nlists = thirdapi_nlists.filter(item => {
	let thirdapi = thirdapi_lists.find(thirdapi => thirdapi.name == item.name);
	if (thirdapi.name) {
		return false
	} else {
		return true
	}
})

authtoken_nlists = authtoken_nlists.filter(item => {
	let authtoken = authtoken_lists.find(authtoken => authtoken.name == item.name);
	if (authtoken.name) {
		return false
	} else {
		return true
	}
})

let response = [];

if (system_nlists.length > 0) {
	response.push(
		mutation({
			operation: "insert_system",
			objects: system_nlists,
			field_string: `id name`
		})
	)
}
if (actionflow_nlists.length > 0) {
	response.push(
		mutation({
			operation: "insert_actionflow",
			objects: actionflow_nlists,
			field_string: `id name`
		})
	)

}
if (thirdapi_nlists.length > 0) {
	response.push(
		mutation({
			operation: "insert_thirdapi",
			objects: thirdapi_nlists,
			field_string: `id name`
		})
	)

}
if (authtoken_nlists.length > 0) {
	response.push(
		mutation({
			operation: "insert_authtoken",
			objects: authtoken_nlists,
			field_string: `id appid thirdapi_name`
		})
	)
}
return {
	thirdapi_lists,
	actionflow_lists,
	system_lists,
	authtoken_lists,
	response
}